package com.joshua.spring.gateway.properties;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * projectName dragon-cloud
 * package com.joshua.spring.gateway.properties
 * classname  SwaggerIgnoreProperties
 * <p>
 * description swagger忽略配置
 * </p>
 *
 * @author <a href="mailto:joshualwork@163.com">joshua_liu</a>
 * @date 2020/8/25 11:36
 */
@Data
@Component
@ConfigurationProperties(prefix = "swagger.api-doc")
public class SwaggerIgnoreProperties implements InitializingBean {
    private List<String> replaceStrings = new ArrayList<>();

    @Override
    public void afterPropertiesSet() throws Exception {
        if (CollectionUtils.isEmpty(this.replaceStrings)) {
            this.replaceStrings.add(",/app");
        }
    }
}
